package gui.houseeditor;

import java.awt.Point;
import java.util.EventObject;


@SuppressWarnings("serial")
public class HouseDataEvent extends EventObject{

    private int x,y;
    
    public HouseDataEvent(Object o,int x,int y){
        super(o);
        if(!(o instanceof HouseModel)) throw new IllegalArgumentException("Source is not a WorldModel!");
        this.x=x;
        this.y=y;
    }
    
    public Point getCellChangedPosition(){
        return new Point(x,y);
    }
    
    public HouseModel.HouseObject getNewValue(){
        return ((HouseModel)source).getCell(x,y);
    }
}
